package dao

import (
	"fmt"
	"gin/CloudRestaurant/model"
	"gin/CloudRestaurant/tool"
)

type UserDao struct {
	*tool.Orm
}

// 查询用户名和密码是否正确
func (ud *UserDao)QuerByUP(username string,password string) *model.User  {
	var user model.User
	if _,err := ud.Where("user_name = ? and password = ?",username,password).Get(&user);err != nil{
		fmt.Println(err.Error())
	}
	return &user
}
